<script>
    // 代码块
    {
    var a = 10
    let b = 20 
    }
    //输出
    console.log(a)
    console.log(b) // 报错 Uncaught ReferenceError: b is not defined
    
    // 结论：let定义变量有作用范围

    
</script>